namespace ghost {
	export class BarrierSettingUILayout {
		private static _intance:BarrierSettingUILayout;
		public static getIntance():BarrierSettingUILayout
		{
			if(BarrierSettingUILayout._intance == null)
				new BarrierSettingUILayout;
			return BarrierSettingUILayout._intance;
		}
		public constructor() {			
			let s =this;
			BarrierSettingUILayout._intance = s;
		}
		private _ui:BarrierSettingUI;
		public layout(s:BarrierSettingUI)
		{
			this._ui = s;
			s.ctrlSp = new Laya.Sprite;
			s.ctrlSp.y = 50;
			s.ctrlSp.width = s.width;
			s.ctrlSp.height = s.height;
			s.addChild(s.ctrlSp);
			let fontSize:number = 18;
			let fontColor:string = "#000000";			
			let padding:number,w:number,h:number;
			let skin:string, checkSkin;
			let self = this;
			padding = 10;
			w = 100;
			h = 42;
			checkSkin = "barrierUI/checkBox.png";
			s.tip = ComCreator.createText(s,"", 230, 10, 300, 30, "#000000", 20);
			s.check0 = <Laya.CheckBox>ComCreator.createButton(s.ctrlSp, "陆地", 20, 0, w,h, checkSkin,fontSize,fontColor,Laya.CheckBox);
			s.check1 = <Laya.CheckBox>ComCreator.createButton(s.ctrlSp, "水路", s.check0.x, s.check0.y + s.check0.height + padding, w,h, checkSkin,fontSize,fontColor,Laya.CheckBox);
			s.check2 = <Laya.CheckBox>ComCreator.createButton(s.ctrlSp, "空路", s.check1.x, s.check1.y + s.check1.height + padding, w,h, checkSkin,fontSize,fontColor,Laya.CheckBox);
			s.check3 = <Laya.CheckBox>ComCreator.createButton(s.ctrlSp, "阴影", s.check2.x, s.check2.y + s.check2.height + padding, w,h, checkSkin,fontSize,fontColor,Laya.CheckBox);			
			
			s.ignoreBtn = ComCreator.createButton(s.ctrlSp, "无障碍行走", s.check3.x, s.check3.y + s.check3.height + padding, w,h, checkSkin,fontSize,fontColor,Laya.CheckBox);			
			s.ignoreBtn.stateNum = s.check0.stateNum = s.check1.stateNum = s.check2.stateNum = s.check3.stateNum = 2;
			skin = Conf.blueBtn;
			
			s.loadBtn = ComCreator.createButton(s.ctrlSp, "读取", s.check0.x, s.ignoreBtn.y + s.ignoreBtn.height + padding, w,h, skin,fontSize,fontColor,Laya.Button);
			s.saveBtn = ComCreator.createButton(s.ctrlSp, "保存", s.check0.x, s.loadBtn.y + s.loadBtn.height + padding, w,h, skin,fontSize,fontColor,Laya.Button);
			s.mapBtn = ComCreator.createButton(s.ctrlSp, "切换地图", s.check0.x, s.saveBtn.y + s.saveBtn.height + padding, w,h, skin,fontSize,fontColor,Laya.Button);
			
			
			
				
			// s.tipImg = new Laya.Image;			
			// s.tipImg.x = s.tipBtn.x;
			// s.tipImg.y = s.tipBtn.y + s.tipBtn.height + 10;
			// s.tipImg.skin = Conf.uiAlias+"barrierTip.png";

			s.commitBtn.visible = false;
			// s.ctrlSp.addChild(s.tipImg);

			// s.check0.gap = s.check1.gap = s.check2.gap = s.check3.gap = 0;
		}
		
	}
}